/*#include<stdio.h>
//#include<stdlib.h>//题目要求编写new和free，所以此头文件不可用.
#include<windows.h>

void *new(unsigned int n);
void free(char *p);
unsigned int n;

int main()
{
	int end = 1,i;
	char *start,*get,*compare;
	while (end == 1)
	{
		printf_s("对n个字符开辟连续的储存空间:\n");
		scanf_s("%d",&n);
		start=new(n);
		for(i = 0 ;i < n  ; i++)
		{
			printf_s("%c\t",*(start+i));
		}
		
		printf_s("\n确认是否将前面new占用的空间释放？(y/n)\n");
		fflush(stdin);
		get = start;//初始化
		gets_s(get,4);
		compare = "y";

		if (strcmp(get,compare) == 0)
		{
			free(start);
			printf_s("已释放\n");
		}
		else
		{
			printf_s("未释放\n");
		}

		printf_s("\nenter 1 to continue or enter 0 to end it:");
		scanf_s("%d", &end);
	}
	system("pause");
	return 0;
}

void *new(unsigned int n)//对n个字符开辟连续的储存空间
{
	char *start;
	start = (char * )malloc(n*sizeof(int));
	return(start);
}

void free(char *p)//将前面new占用的空间释放
{
	int i;
	for (i = 0; i < n; i++)
	{
		*(p + i) = NULL;
		printf_s("%c\t", *(p + i));
	}
}*/
